IsProperSubsetOf Generic Method

Wintellect PowerCollections

Collapse imageExpand ImageCollapseAll imageExpandAll imageDropDown imageDropDownHover imageCopy imageCopyHover image
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Determines if one collection is a proper subset of another, considered as sets. The first set is a proper subset of the second set if every item in the first set also occurs in the second set, and the first set is strictly smaller than the second set. If an item appears X times in the first set, it must appear at least X times in the second set.

Namespace: Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax

C#
public static bool IsProperSubsetOf<T>(
	IEnumerable<T> collection1,
	IEnumerable<T> collection2
)
Visual Basic (Declaration)
Public Shared Function IsProperSubsetOf(Of T) ( _
	collection1 As IEnumerable(Of T), _
	collection2 As IEnumerable(Of T) _
) As Boolean
Visual C++
public:
generic<typename T>
static bool IsProperSubsetOf (
	IEnumerable<T>^ collection1, 
	IEnumerable<T>^ collection2
)

Parameters

collection1
IEnumerable<(Of <T>)>
The first collection.
collection2
IEnumerable<(Of <T>)>
The second collection.

Return Value

True if collection1 is a subset of collection2, considered as sets.

Type Parameters

T

Remarks

The default sense of equality for T is used, as defined by T's implementation of IComparable<T>.Equals or object.Equals.

If both collections are Set, Bag, OrderedSet, or OrderedBag collections, it is more efficient to use the IsSubsetOf method on that class.

Exceptions

ExceptionCondition
System..::ArgumentNullExceptioncollection1 or collection2 is null.

See Also